<template>
  <Layout class="ivu-layout-has-sider cloud-layout">
    <!-- 侧边栏 -->
    <zl-sider :isCollapsed.sync="isCollapsed" ref="side" @menuUpdate="menuUpdate"></zl-sider>

    <Layout class="cloud-layout-body" :class="{'collapse': isCollapsed}" is-vertical>
      <zl-head :menus="secondMenu" @collapsedSider="collapsedSider" :isCollapsed="isCollapsed" :menuName="menuName"></zl-head>
      <!-- <Content :style="{margin: '16px', background: '#f0f2f5', minHeight: '88%', minWidth: '1000px'}"> -->
      <Content class="cloud-layout-content" id="layoutContent">
        <!-- <router-view></router-view> -->
        <nuxt-child/>
      </Content>
    </Layout>
  </Layout>
</template>

<script>
import ZlHead from '@/components/layout/head'
import ZlSider from '@/components/layout/sider'

export default {
  name: 'HomeIndex',
  components: {
    ZlHead, ZlSider
  },
  data() {
    return {
      isCollapsed: false,
      menuName: '',
      secondMenu: []
    }
  },
  created() {
  },
  methods: {
    // 收缩左侧菜单
    collapsedSider() {
      this.$refs.side.$refs.sider.toggleCollapse()
    },
    menuUpdate(menu) {
      this.secondMenu = menu.second
      this.menuName = menu.name
    }
  }
}
</script>

<style lang="scss" scoped>
.ivu-layout.ivu-layout-has-sider {
  height: 100%;
  -webkit-box-orient: horizontal;
  -webkit-box-direction: normal;
  -ms-flex-direction: row;
  flex-direction: row;
}
.cloud-layout-body {
  min-width: 950px;
}
.cloud-layout-content {
  position: relative;
  padding: 80px 20px 50px 20px;
}
.layout {
  height: 100%;
  border: 1px solid #d7dde4;
  background: #f5f7f9;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
}

.layout-logo-left {
  width: 90%;
  height: 30px;
  background: #5b6270;
  border-radius: 3px;
  margin: 15px auto;
}
.layout-header-bar.ivu-layout-header {
  position: fixed;
  left: 240px;
  right: 0;
  top: 0;
  z-index: 99;
  background: #fff;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  padding: 0 18px 0 0;
  height: 60px;
  border-bottom: 1px solid #f5f5f5;
  transition: all 0.3s ease;
  &.collapse {
    left: 88px;
  }
}
</style>
